import 'package:flutter/material.dart';
import 'package:hospitable_rental/pages/home/profile/function_buttons_item.dart';
import 'package:hospitable_rental/widgets/common_image.dart';

class FunctionButton extends StatelessWidget {
  final FunctionButtonItem item;

  const FunctionButton(
    this.item, {
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var col = 3;

    return GestureDetector(
      onTap: () => item.onTapHandler!(context),
      child: Container(
        width: (MediaQuery.of(context).size.width - 10 * (col - 1)) / col,
        child: Column(
          children: [
            CommonImage(
              item.imageUri,
              height: 50.0,
              width: 50.0,
            ),
            Text(item.title),
          ],
        ),
      ),
    );
  }
}
